//
//  XPImageDowloader.swift
//  XPWebImage
//
//  Created by jamalping on 16/5/9.
//  Copyright © 2016年 jamalping. All rights reserved.
//

import Foundation

class XPImageDowloader {
    public var httpHeaders: [String: String]?
    
    public var operation: NSOperation?
    
    
//    public func headersFilter(url: NSURL, headers: [Sreing: String]) -> [String: Stirng]? {
//        
//    }
    
    public func dowloaderImageWithURL(URL: NSURL) {
        let request = NSMutableURLRequest.init(URL: URL, cachePolicy: .UseProtocolCachePolicy, timeoutInterval: 15.0)
        request.HTTPShouldHandleCookies = true
        request.HTTPShouldUsePipelining = true
        
        if let headers = httpHeaders {
            request.allHTTPHeaderFields = headers
        }
        
        operation = NSOperation.init
    }
}